package com.xcesys.extras.remoting.system;

import java.util.Collection;
import java.util.List;

import javax.jws.WebParam;
import javax.jws.WebService;

import com.xcesys.extras.dataobject.system.CodeList;
import com.xcesys.extras.dataobject.system.CodeType;
import com.xcesys.extras.dataobject.system.Resource;
import com.xcesys.extras.dataobject.system.Role;
import com.xcesys.extras.dataobject.system.Setting;
import com.xcesys.extras.dataobject.system.User;

@WebService(targetNamespace = "com.xcesys.extras.remoting.system", serviceName = "SystemManagementService")
public interface RSystemManagementService {

	public void doAddResourcesToRole(@WebParam(name = "roleId") Long roleId,
			@WebParam(name = "resources") Collection<Resource> resources);

	public void doAddRolesToUser(Long userId, List<Long> roles);

	public void doAddUsersToRole(@WebParam(name = "roleId") Long roleId,
			@WebParam(name = "users") List<Long> userIds);

	public CodeList doCreateCodeList(CodeList codelist);

	public CodeType doCreateCodeType(CodeType codeType);

	public Resource doCreateResource(
			@WebParam(name = "resource") Resource resource);

	public Role doCreateRole(@WebParam(name = "role") Role role);

	Setting doCreateSetting(Setting parameter);

	public User doCreateUser(User user);

	public void doDeleteCodeList(CodeList codelist);

	public void doDeleteCodeType(CodeType codeType);

	public void doDeleteResource(@WebParam(name = "resource") Resource resource);

	public void doDeleteRole(@WebParam(name = "role") Role role);

	public void doDeleteSetting(Setting parameter);

	public void doDeleteUser(User user);

	public Collection<CodeList> doFindAllCodeLists();

	public Collection<CodeType> doFindAllCodeTypes();

	public Collection<Resource> doFindAllResources();

	public Collection<Role> doFindAllRoles();

	Collection<Setting> doFindAllSettings();

	public Collection<User> doFindAllUsers();

	public CodeList doFindCodeListById(Long id);

	public Collection<CodeList> doFindCodeLists(String type);

	public CodeType doFindCodeTypeById(Long id);

	public Collection<CodeType> doFindCodeTypesByType(String type);

	public Resource doFindResourceById(
			@WebParam(name = "resourceId") Long resourceId);

	public Collection<Resource> doFindResourcesByParentId(
			@WebParam(name = "parentResourceId") Long parentResourceId);

	public Collection<Resource> doFindResourcesByParentIdAndType(
			@WebParam(name = "parentResourceId") Long parentResourceId,
			@WebParam(name = "resourceType") String resourceType);

	public Collection<Resource> doFindResourcesByParentIdAndTypes(
			@WebParam(name = "parentResourceId") Long parentResourceId,
			@WebParam(name = "resourceTypes") String[] resourceTypes);

	public Collection<Resource> doFindResourcesByRoleId(
			@WebParam(name = "roleId") Long roleId);

	public Collection<Resource> doFindResourcesByType(
			@WebParam(name = "resourceType") String resourceType);

	public Collection<Resource> doFindResourcesInRoleNames(
			@WebParam(name = "roleNames") String[] roleNames);

	public Collection<Role> doFindRolesByCondition(
			@WebParam(name = "roleName") String nameEn, String nameZh,
			@WebParam(name = "roleDesc") String description);

	public Role doFindRolesByRoleId(@WebParam(name = "roleId") Long roleId);

	public Collection<Role> doFindRolesByUserId(
			@WebParam(name = "userId") Long userId);

	public Collection<Role> doFindRolesByUsername(
			@WebParam(name = "username") String username);

	Setting doFindSettingById(Long id);

	public User doFindUserById(Long id);

	public User doFindUserByUsername(String username);

	public Collection<User> doFindUsersByRoleId(
			@WebParam(name = "roleId") Long roleId);

	public Collection<User> doFindUsersByRoleName(
			@WebParam(name = "rolename") String rolename);

	public void doRemoveResourcesFromRole(
			@WebParam(name = "roleId") Long roleId,
			@WebParam(name = "resources") Collection<Resource> resources);

	public void doRemoveRolesFromUser(Long userId, Collection<Role> roles);

	public void doRemoveUsersFromRole(@WebParam(name = "roleId") Long roleId,
			@WebParam(name = "users") List<Long> userIds);

	public CodeList doUpdateCodeList(CodeList codelist);

	public CodeType doUpdateCodeType(CodeType codeType);

	public Resource doUpdateResource(
			@WebParam(name = "resource") Resource resource);

	public Role doUpdateRole(@WebParam(name = "role") Role role);

	public Setting doUpdateSetting(Setting parameter);

	public User doUpdateUser(User user);

}
